package com.add.petback.service.impl;

import com.add.petback.dao.UserMapper;
import com.add.petback.model.User;
import com.add.petback.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (User)表服务实现类
 *
 * @author makejava
 * @since 2020-03-10 15:54:09
 */
@Service("userService")
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper mapper;

    @Override
    public void insert(User object) {
        mapper.insertSelective(object);
    }

    @Override
    public void save(User object) {
        mapper.updateByPrimaryKeySelective(object);
    }

    @Override
    public List<User> getAll() {
        return mapper.list(new User());
    }

    @Override
    public User find(User object) {
        return mapper.find(object);
    }

    @Override
    public void delete(User object) {
        mapper.deleteByPrimaryKey(object.getUserpk());
    }

    @Override
    public List<User> getList(User object) {
        return mapper.list(object);
    }

}